import request from '@/utils/request.js'



//考试列表查询
export const examListService =  (params) => {
    return request.get('/teacher/getExamInfo', { params: params });
};

export const examSearchService =  (examSearch,params) => {
    return request.post('/teacher/searchExam', examSearch,{params: params});
};

//考试添加
export const examAddService = (examCreate)=>{
    return request.post('/teacher/createExam',examCreate);
}

// 删除考试
export const examDeleteService = (examId) => {
    return request.delete(`/teacher/deleteExam?examId=${examId}`);
};

// 下载考试归档
export const examDownloadZipService = (id) => {
    return request.get(`/exam/download/${id}`, { responseType: 'blob' });
};

// 更新考试信息
export const examUpdateService = (formData) => {
    return request.post('/teacher/updateExam', formData);
};

export const examUpdateStatusService = async (examId) => {
    return await request.get(`/teacher/updateExamStatus?examId=${examId}`);
};

// 考试状态查询
export const examStatusService = (id) => {
    return request.get(`/exam/status/${id}`);
};



export const studentListService =  (params) => {
    return request.get('/teacher/getExamStudentInfo', { params: params });
};

export const searchStudentService=(searchForm,params)=>{
    return request.post('/teacher/findStudentExam', searchForm,{params: params});
}

export const examStudentAddService =(examStudentAdd)=>{
    return request.post('/teacher/addStudentExam',examStudentAdd)
}

export const excelUploadService=(formData)=>{
    return request.post('/teacher/excelUpload',formData)
}

export const studentDeleteService=(id)=>{
    return request.delete(`/teacher/deleteStudent?studentId=${id}`);
}
